<?php

/** 
* 
* 
* by:南宁火蝶科技有限公司 http:///www.HdsysCms.com
* 声明:本系统禁止用二次开发、侵犯HdsysCms著作和除去HdsysCms进行售卖,如发现将追究一切权利,模版制作属于自己所得可以通过本系统对外开发模版获取收益!
* 
* 2019年第一版本发布 - 到2023.9.1开源使用! 
* php混淆工具:phpencry.wbox.top
* 
* 注意防骗:@HdsysCms 官方没授权任何个人机构合作,唯一收款抬头:《南宁火蝶科技有限公司》和官网显示客服唯一渠道客服,其它渠道以HdsysCms名义行为均骗子!
*
*/
	

defined('HDSYS_SET') or call_my_die("" . 'Not,This File Not Can in Ie Open');
if (HDSYS_SET !='ADMIN') {
call_my_die("" . '访问路径错误');
}
class Category
{
private $intelligence_db,$intelligence_session;
public function __construct()
{
$this->intelligence_session=bs_lib::load_libhdsys_class("" . 'session');
$this->intelligence_session->intelligence_session_open();
$this->intelligence_db=bs_lib::load_libhdsys_class(templates_Verifications_db());
bs_lib::load_modules_common();
isadminlogin();
}
public function call_input_sort_ajax()
{
$param_id=(int)set_post("" . 'id');
$param_sort=(int)set_post("" . 'sort');
$param_sql="UPDATE `hdsys_list` SET `sort`={$param_sort}  WHERE `hdsys_list`.`id`={$param_id};";
$param_tmp=$this->intelligence_db->intelligence_query($param_sql);
if ($param_tmp) {
print_json(array(call_my_str_code()=> call_my_int_1(), call_my_str_msg()=> '排序修改成功.'));
} else {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '失败'));
}
}
public function call_top_ajax()
{
$param_id=set_post("" . 'id');
$param_sql="SELECT * FROM `hdsys_list` WHERE id='{$param_id}'  ";
$param_listrarr=$this->intelligence_db->intelligence_array($param_sql);
if (!$param_listrarr) {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '栏目不存在'));
}
$param_sql="SELECT * FROM `hdsys_list` WHERE pid='{$param_listrarr['pid']}' and sort < {$param_listrarr['sort']} and sort !={$param_listrarr['sort']}  ORDER BY`sort` DESC LIMIT 1";
$param_listrarr_add=$this->intelligence_db->intelligence_array($param_sql);
if (!$param_listrarr_add) {
$param_sql="UPDATE `hdsys_list` SET `sort`=`sort` - '1' WHERE `hdsys_list`.`id`={$param_listrarr['id']};";
$param_tmp=$this->intelligence_db->intelligence_query($param_sql);
if ($param_tmp) {
print_json(array(call_my_str_code()=> call_my_int_1(), call_my_str_msg()=> '上移成功.'));
} else {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '失败'));
}
}
$param_sql="UPDATE `hdsys_list` SET `sort`={$param_listrarr_add['sort']} - 1 WHERE `hdsys_list`.`id`={$param_listrarr['id']};";
$param_tmp=$this->intelligence_db->intelligence_query($param_sql);
if ($param_tmp) {
print_json(array(call_my_str_code()=> call_my_int_1(), call_my_str_msg()=> '上移成功..'));
} else {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '失败'));
}
}
public function call_down_ajax()
{
$param_id=set_post("" . 'id');
$param_sql="SELECT * FROM `hdsys_list` WHERE id='{$param_id}'  ";
$param_listrarr=$this->intelligence_db->intelligence_array($param_sql);
if (!$param_listrarr) {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '栏目不存在'));
}
$param_sql="SELECT * FROM `hdsys_list` WHERE pid='{$param_listrarr['pid']}' and sort > {$param_listrarr['sort']} and sort !={$param_listrarr['sort']}  ORDER BY`sort` ASC LIMIT 1";
$param_listrarr_add=$this->intelligence_db->intelligence_array($param_sql);
if (!$param_listrarr_add) {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '已经在栏目最下面'));
}
$param_sql="UPDATE `hdsys_list` SET `sort`={$param_listrarr['sort']} WHERE `hdsys_list`.`id`={$param_listrarr_add['id']};";
$param_tmp=$this->intelligence_db->intelligence_query($param_sql);
$param_sql="UPDATE `hdsys_list` SET `sort`={$param_listrarr_add['sort']} WHERE `hdsys_list`.`id`={$param_listrarr['id']};";
$param_tmp=$this->intelligence_db->intelligence_query($param_sql);
if ($param_tmp) {
print_json(array(call_my_str_code()=> call_my_int_1(), call_my_str_msg()=> '下移成功'));
} else {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '失败'));
}
}
public function call_edit_ajax()
{
$param_id=set_post("" . 'id');
$param_pid=set_post("" . 'pid');
$param_name=set_post("" . 'name');
$param_ename=set_post("" . 'ename');
$param_template=set_post("" . 'template');
$param_static_url=set_post("" . 'static_url');
$param_seotitle=set_post("" . 'seotitle');
$param_seokeywords=set_post("" . 'seokeywords');
$param_seodescription=set_post("" . 'seodescription');
$param_eseotitle=set_post("" . 'eseotitle');
$param_eseokeywords=set_post("" . 'eseokeywords');
$param_eseodescription=set_post("" . 'eseodescription');
$param_markdown=htmltolashes(set_post("" . 'markdown'));
$param_emarkdown=htmltolashes(set_post("" . 'emarkdown'));
$param_content=htmltolashes(set_post("" . 'content'));
$param_econtent=htmltolashes(set_post("" . 'econtent'));
$url=set_post("" . 'url');
$eurl=set_post("" . 'eurl');
$param_sort=set_post("" . 'sort');
$param_sdates=set_post("" . 'sdates');
if ($param_name=='') {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '栏目名称不能空'));
}
if ($param_template=='') {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '视图模版不能空'));
}
$param_template_file='';
if ($param_static_url=='') {
$param_static_url=set_static_url('list');
}
if (my_static_url($param_static_url, $param_id)) {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> 'ID' . $param_id . '当前为静态URL[' . $param_static_url . ']连接已经存在数据库'));
}
$param_tmp=$this->intelligence_db->intelligence_update(
'hdsys_list',
array(
'pid'=> $param_pid, 'name'=> $param_name, 'ename'=> $param_ename, 'template'=> $param_template, 'static_url'=> $param_static_url, 'template'=> $param_template, 'seotitle'=> $param_seotitle, 'seokeywords'=> $param_seokeywords, 'seodescription'=> $param_seodescription, 'eseotitle'=> $param_eseotitle, 'eseokeywords'=> $param_eseokeywords, 'eseodescription'=> $param_eseodescription, 'content'=> $param_content, 'econtent'=> $param_econtent, 'url'=> $url, 'eurl'=> $eurl, 'sdates'=> $param_sdates, 'sort'=> $param_sort, 'markdown'=> $param_markdown, 'emarkdown'=> $param_emarkdown
),
" id={$param_id} "
);
if ($param_tmp) {
print_json(array(call_my_str_code()=> call_my_int_1(), call_my_str_msg()=> '修改成功'));
} else {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '添加失败'));
}
}
public function call_edit()
{
$param_id=set_get('listid');
if (!$param_id) {
echo '错误路径id';
}
$param_sql="SELECT*FROM`hdsys_list` WHERE `id`='{$param_id}' ORDER BY`sort`ASC LIMIT 1";
$param_db_array_value=$this->intelligence_db->intelligence_array($param_sql);
if (!$param_db_array_value) {
echo '错误路径';
}
$param_templates=call_my_get_page_list('list');
include bs_lib::load_default_path();
}
public function call_table()
{
$param_sql="SELECT*FROM`hdsys_list`WHERE `pid` !='0'  LIMIT 1000";
$param_db_array_value=$this->intelligence_db->intelligence_query($param_sql);
while ($param_value=$this->intelligence_db->intelligence_assoc($param_db_array_value)) {
$param_sql="SELECT*FROM`hdsys_list`WHERE `id`='{$param_value['pid']}'  LIMIT 1";
$param_db_array=$this->intelligence_db->intelligence_array($param_sql);
if (!$param_db_array) {
$param_sql="UPDATE `hdsys_list` SET `pid`='0' WHERE `id`='{$param_value['id']}';";
$this->intelligence_db->intelligence_query($param_sql);
}
}
include bs_lib::load_default_path();
}
public function call_list_ajax()
{
$param_pid_arr=set_get('pid_arr');
$param_pid_arr=explode(',', $param_pid_arr);
$param_while_array_list_all=array();
$param_while_array_list_all=$this->GetListArray(0, $param_pid_arr);
$param_json_array=array();
$param_json_array[call_my_str_data()]=$param_while_array_list_all;
$param_json_array[call_my_str_code()]=1;
$param_json_array[call_my_str_msg()]='ok';
$param_json_array['status']=array(call_my_str_code()=> 200, 'message'=> "操作成功");;
print_json($param_json_array);
}
public function call_manager_ajax()
{
$param_php_path=HDSYS_DIR_SYS . '/';
$param_php_url='../';
$param_root_path=$param_php_path . '/upfiles/attached/';
$root_url=$param_php_url . 'upfiles/attached/';
$param_ext_arr=array('gif', 'jpg', 'jpeg', 'png', 'bmp');
$param_dir_name=empty($_GET['dir']) ? '' : trim($_GET['dir']);
if (!in_array($param_dir_name, array('', 'image', 'flash', 'media', 'file'))) {
echo "Invalid Directory name.";
exit;
}
if ($param_dir_name !=='') {
$param_root_path .=$param_dir_name . "/";
$root_url .=$param_dir_name . "/";
if (!file_exists($param_root_path)) {
mkdir($param_root_path);
}
}
$param_get_path=set_get("path");
if (empty($param_get_path)) {
$param_current_path=realpath($param_root_path) . '/';
$param_current_url=$root_url;
$current_dir_path='';
$moveup_dir_path='';
} else {
$param_current_path=realpath($param_root_path) . '/' . $param_get_path;
$param_current_url=$root_url . $param_get_path;
$current_dir_path=$param_get_path;
$moveup_dir_path=preg_replace('/(.*?)[^\/]+\/$/', '$1', $current_dir_path);
}
$param_order=empty(set_get("order")) ? 'name' : strtolower(set_get("order"));
if (preg_match('/\.\./', $param_current_path)) {
echo 'Access is not allowed.';
exit;
}
if (!preg_match('/\/$/', $param_current_path)) {
echo 'Parameter is not valid.';
exit;
}
if (!file_exists($param_current_path) || !is_dir($param_current_path)) {
echo 'Directory does not exist.';
exit;
}
$param_file_list=array();
if ($param_handle=opendir($param_current_path)) {
$i=0;
while (false !==($param_filename=readdir($param_handle))) {
if (substr($param_filename, 0, 1)=='.') {
continue;
}
$param_file=$param_current_path . $param_filename;
if (is_dir($param_file)) {
$param_file_list[$i]['is_dir']=true;
$param_file_list[$i]['has_file']=(count(scandir($param_file)) > 2);
$param_file_list[$i]['filesize']=0;
$param_file_list[$i]['is_photo']=false;
$param_file_list[$i]['filetype']='';
} else {
$param_file_list[$i]['is_dir']=false;
$param_file_list[$i]['has_file']=false;
$param_file_list[$i]['filesize']=filesize($param_file);
$param_file_list[$i]['dir_path']='';
$param_file_ext=strtolower(pathinfo($param_file, PATHINFO_EXTENSION));
$param_file_list[$i]['is_photo']=in_array($param_file_ext, $param_ext_arr);
$param_file_list[$i]['filetype']=$param_file_ext;
}
$param_file_list[$i]['filename']=$param_filename;
$param_file_list[$i]['datetime']=call_my_date('Y-m-d H:i:s', filemtime($param_file));
$i++;
}
closedir($param_handle);
}
function cmp_func($a, $b)
{
global $param_order;
if ($a['is_dir'] && !$b['is_dir']) {
return -1;
} elseif (!$a['is_dir'] && $b['is_dir']) {
return 1;
} else {
if ($param_order=='size') {
if ($a['filesize'] > $b['filesize']) {
return 1;
} elseif ($a['filesize'] < $b['filesize']) {
return -1;
} else {
return call_my_int_0();
}
} elseif ($param_order=='type') {
return strcmp($a['filetype'], $b['filetype']);
} else {
return strcmp($a['filename'], $b['filename']);
}
}
}
usort($param_file_list, 'cmp_func');
$param_result=array();
$param_result['moveup_dir_path']=$moveup_dir_path;
$param_result['current_dir_path']=$current_dir_path;
$param_result['current_url']=$param_current_url;
$param_result['total_count']=count($param_file_list);
$param_result['file_list']=$param_file_list;
print_json($param_result);
}
public function call_up_ajax()
{
$param_php_path=HDSYS_DIR_SYS . '/';
$param_php_url=bs_lib::get_configs_value('setup', 'domain');
if ($param_php_url=='') {
print_json(array('error'=> 1, 'success'=> 0, 'message'=> '请在网站设置->配置好系统域名'));
}
$param_save_path=$param_php_path . '/upfiles/attached/';
$param_save_url=$param_php_url . 'upfiles/attached/';
if (is_dir($param_php_path . '/upfiles/attached')===false) {
mkdir($param_php_path . '/upfiles/attached', 0777, true);
}
$param_ext_arr=array(
'image'=> array('gif', 'jpg', 'jpeg', 'png', 'bmp'),
'flash'=> array('swf', 'flv'),
'media'=> array('swf', 'flv', 'mp3', 'wav', 'wma', 'wmv', 'mid', 'avi', 'mpg', 'asf', 'rm', 'rmvb'),
'file'=> array('doc', 'docx', 'xls', 'xlsx', 'ppt', 'htm', 'html', 'txt', 'zip', 'rar', 'gz', 'bz2'),
);
$param_max_size=1000000;
$param_save_path=realpath($param_save_path) . '/';
if (!empty($_FILES['imgFile']['error'])) {
switch ($_FILES['imgFile']['error']) {
case '1':
$param_error='超过php.ini允许的大小。';
break;
case '2':
$param_error='超过表单允许的大小。';
break;
case '3':
$param_error='图片只有部分被上传。';
break;
case '4':
$param_error='请选择图片。';
break;
case '6':
$param_error='找不到临时目录。';
break;
case '7':
$param_error='写文件到硬盘出错。';
break;
case '8':
$param_error='File upload stopped by extension。';
break;
case '999':
default:
$param_error='未知错误。';
}
print_json(array('error'=> 1, 'success'=> 0, 'message'=> $param_error));
}
if (empty($_FILES)===false) {
$param_File_Name=$_FILES['imgFile']['name'];
$param_tmp_name=$_FILES['imgFile']['tmp_name'];
$param_file_size=$_FILES['imgFile']['size'];
if (!$param_File_Name) {
print_json(array('error'=> 1, 'success'=> 0, 'message'=> "请选择文件。"));
}
if (@is_dir($param_save_path)===false) {
print_json(array('error'=> 1, 'success'=> 0, 'message'=> "上传目录不存在。"));
}
if (@is_writable($param_save_path)===false) {
print_json(array('error'=> 1, 'success'=> 0, 'message'=> "上传目录没有写权限。"));
}
if (@is_uploaded_file($param_tmp_name)===false) {
print_json(array('error'=> 1, 'success'=> 0, 'message'=> "上传失败。"));
}
if ($param_file_size > $param_max_size) {
print_json(array('error'=> 1, 'success'=> 0, 'message'=> "上传文件大小超过限制。"));
}
$param_dir_name=empty(set_get('dir')) ? 'image' : trim(set_get('dir'));
if (empty($param_ext_arr[$param_dir_name])) {
print_json(array('error'=> 1, 'success'=> 0, 'message'=> "目录名不正确。"));
}
$temp_arr=explode('.', $param_File_Name);
$param_file_ext=array_pop($temp_arr);
$param_file_ext=trim($param_file_ext);
$param_file_ext=strtolower($param_file_ext);
if (in_array($param_file_ext, $param_ext_arr[$param_dir_name])===false) {
print_json(array('error'=> 1, 'success'=> 0, 'message'=> "上传文件扩展名是不允许的扩展名。\n只允许" . implode(",", $param_ext_arr[$param_dir_name]) . "格式。"));
}
if ($param_dir_name !=='') {
$param_save_path .=$param_dir_name . "/";
$param_save_url .=$param_dir_name . "/";
if (!file_exists($param_save_path)) {
mkdir($param_save_path);
}
}
$param_ymd=date("Ymd");
$param_save_path .=$param_ymd . "/";
$param_save_url .=$param_ymd . "/";
if (!file_exists($param_save_path)) {
mkdir($param_save_path);
}
$param_new_file_name=date("YmdHis") . '_' . rand(10000, 99999) . '.' . $param_file_ext;
$param_file_path=$param_save_path . $param_new_file_name;
if (move_uploaded_file($param_tmp_name, $param_file_path)===false) {
print_json(array('error'=> 1, 'success'=> 0, 'message'=> "上传文件失败。"));
}
$param_file_url=$param_save_url . $param_new_file_name;
print_json(array('error'=> 0, 'success'=> call_my_int_1(), 'url'=> $param_file_url));
}
}
public function call_add()
{
$param_templates=call_my_get_page_list('list');
include bs_lib::load_default_path();
}
public function call_add_ajax()
{
$param_pid=set_post("" . 'pid');
$param_seltree_select_input=set_post("" . 'seltree_select_input');
$param_name=set_post("" . 'name');
$param_ename=set_post("" . 'ename');
$param_template=set_post("" . 'template');
$param_static_url=set_post("" . 'static_url');
$param_seotitle=set_post("" . 'seotitle');
$param_seokeywords=set_post("" . 'seokeywords');
$param_seodescription=set_post("" . 'seodescription');
$param_eseotitle=set_post("" . 'eseotitle');
$param_eseokeywords=set_post("" . 'eseokeywords');
$param_eseodescription=set_post("" . 'eseodescription');
$param_markdown=htmltolashes(set_post("" . 'markdown'));
$param_emarkdown=htmltolashes(set_post("" . 'emarkdown'));
$param_content=htmltolashes(set_post("" . 'content'));
$param_econtent=htmltolashes(set_post("" . 'econtent'));
$param_sdates=set_post("" . 'sdates');
$url=set_post("" . 'url');
$eurl=set_post("" . 'eurl');
$param_sort=set_post("" . 'sort');
if ($param_name=='') {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '栏目名称不能空'));
}
if ($param_template=='') {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '视图模版不能空'));
}
if ($param_static_url=='') {
$param_static_url=set_static_url('list');
}
if (my_static_url($param_static_url, 0)) {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '当前为静态URL[' . $param_static_url . ']连接已经存在数据库'));
}
$param_template_file='';
if ($param_sort=='') {
$param_sql="select count(*)as 'hangshu' from `hdsys_list` ";
$param_tmp_arr=$this->intelligence_db->intelligence_array($param_sql);
$param_sort=(int)$param_tmp_arr['hangshu'] + 1;
}
$param_tmp=$this->intelligence_db->intelligence_insert(
'hdsys_list',
array(
'pid'=> $param_pid, 'name'=> $param_name, 'ename'=> $param_ename, 'sdates'=> $param_sdates, 'template'=> $param_template, 'static_url'=> $param_static_url
, 'seotitle'=> $param_seotitle, 'seokeywords'=> $param_seokeywords, 'seodescription'=> $param_seodescription, 'eseotitle'=> $param_eseotitle, 'eseokeywords'=> $param_eseokeywords, 'eseodescription'=> $param_eseodescription, 'sort'=> $param_sort, 'markdown'=> $param_markdown, 'emarkdown'=> $param_emarkdown, 'content'=> $param_content, 'econtent'=> $param_econtent, 'url'=> $url, 'eurl'=> $eurl
)
);
if ($param_tmp) {
print_json(array(call_my_str_code()=> call_my_int_1(), call_my_str_msg()=> '添加成功'));
} else {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '添加失败'));
}
}
public function call_del_ajax()
{
$param_id=set_post("" . 'id');
$param_sql="SELECT*FROM`hdsys_list`WHERE `pid`='{$param_id}'  LIMIT 1";
$param_db_array_value=$this->intelligence_db->intelligence_array($param_sql);
if ($param_db_array_value) {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> $param_db_array_value['name'] . ' 删除失败,还有子栏目,先把子栏目移除在删除.'));
}
$param_sql="DELETE FROM `hdsys_list` WHERE `id`='{$param_id}'";
$param_tmp=$this->intelligence_db->intelligence_query($param_sql);
if ($param_tmp) {
print_json(array(call_my_str_code()=> call_my_int_1(), call_my_str_msg()=> '删除成功'));
} else {
print_json(array(call_my_str_code()=> call_my_int_aeg1(), call_my_str_msg()=> '删除失败'));
}
}
public function call_select_ajax()
{
$param_while_array_list_all[]=array(
'title'=> '导航顶级栏目', 'id'=> 0, 'parentId'=> 0
);
$param_while_array_list_all=array_merge($param_while_array_list_all, $this->GetListArray(0));
$param_json_array=array();
$param_json_array[call_my_str_data()]=$param_while_array_list_all;
$param_json_array[call_my_str_code()]=1;
$param_json_array[call_my_str_msg()]='ok';
$param_json_array['status']=array(call_my_str_code()=> 200, 'message'=> "操作成功");;
print_json($param_json_array);
}
public function call_select_template_ajax()
{
$param_template=set_get('template');
$param_while_array_list_all[]=array();
$param_while_array_list_all=$this->GetListTemplateArray(0, $param_template);
$param_json_array=array();
$param_json_array[call_my_str_data()]=$param_while_array_list_all;
$param_json_array[call_my_str_code()]=1;
$param_json_array[call_my_str_msg()]='ok';
$param_json_array['status']=array(call_my_str_code()=> 200, 'message'=> "操作成功");;
print_json($param_json_array);
}
public function GetListTemplateArray($param_pid, $param_template)
{
$param_sql="SELECT*FROM`hdsys_list`WHERE `pid`='{$param_pid}' ORDER BY`sort`ASC LIMIT 1000";
$param_db_array_value=$this->intelligence_db->intelligence_query($param_sql);
$param_while_array_list_all=array();
while ($param_value=$this->intelligence_db->intelligence_assoc($param_db_array_value)) {
$param_children=$this->GetListTemplateArray($param_value['id'], $param_template);
if ($param_value['ename']=='') {
$param_title=$param_value['name'];
} else {
$param_title=$param_value['name'] . " (英:{$param_value['ename']})";
}
if ($param_value['template']==$param_template) {
$param_hide=false;
} else {
if ($param_value['pid']==0) {
if (count($param_children)==0) {
$param_hide=true;
} else {
$param_hide=false;
}
} else {
$param_hide=true;
}
}
if ($param_hide==false) {
$param_while_array_list_all[]=array(
'title'=> $param_title, 'id'=> $param_value['id'], 'parentId'=> $param_value['pid'], 'children'=> $param_children, 'disabled'=> $param_value['template']==$param_template ? false : true, "ficonClass"=> "", "iconClass"=> $param_value['pid'] > 0 ? "" : "dtree-icon-home1", "hide"=> $param_hide
);
}
}
return $param_while_array_list_all;
}
public function GetListArray($param_pid, $param_pid_arr=array())
{
$param_sql="SELECT*FROM`hdsys_list`WHERE `pid`='{$param_pid}' ORDER BY`sort`ASC LIMIT 1000";
$param_db_array_value=$this->intelligence_db->intelligence_query($param_sql);
$param_while_array_list_all=array();
while ($param_value=$this->intelligence_db->intelligence_assoc($param_db_array_value)) {
$param_children=$this->GetListArray($param_value['id'], $param_pid_arr);
if ($param_value['ename']=='') {
$param_title=$param_value['name'];
} else {
$param_title=$param_value['name'];
}
if ($param_value['template'] !='jmp' and $param_value['template'] !='page') {
if (in_array($param_value['id'], $param_pid_arr)) {
$param_checked=1;
} else {
$param_checked=0;
}
} else {
$param_checked=0;
}
$param_template=$param_value['template'];
$param_while_array_list_all[]=array(
"checkArr"=> array('type'=> 0, 'checked'=> $param_checked), 'basicData'=> array('sort'=> $param_value['sort'], 'template'=> $param_template, 'static_url'=> $param_value['static_url'], 'url'=> $param_value['url']), 'title'=> $param_title, 'id'=> $param_value['id'], 'parentId'=> $param_value['pid'], 'children'=> $param_children, "iconClass"=> $param_value['pid'] > 0 ? "" : "dtree-icon-home1"
);
}
return $param_while_array_list_all;
}
}
